package com.itheima.review.feign;

import com.itheima.apis.review.IReviewClient;
import com.itheima.model.common.dtos.ResponseResult;
import com.itheima.review.service.impl.ReviewServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReviewClient implements IReviewClient {
    @Autowired
    private ReviewServiceImpl reviewService;
    @Override
    @GetMapping("/api/v1/review/book/count")
    public ResponseResult countReviewsByBookForUser(@RequestParam Integer userId) {
        return reviewService.countReviewsByBookForUser(userId);
    }
}
